package com.insigma.business.gateway.api;

import org.apache.commons.lang3.ArrayUtils;

public class SpiCheckUtils {

    private SpiCheckUtils(){}

    public static void checkIsTrue(final boolean boolExpression, final String... errorMsgArray) {
        final StringBuilder stringBuilder = new StringBuilder();

        if (ArrayUtils.isNotEmpty(errorMsgArray)) {
            for (String str : errorMsgArray) {
                stringBuilder.append(str);
            }
        }

        if (!boolExpression) {
            throw new RuntimeException(stringBuilder.toString());
        }
    }
}
